Skip to content

Conversation

brolnickij
Copy link
Contributor

@brolnickij brolnickij commented Sep 14, 2025

Introduction

client-ofetch came out of this discussion #2618 (comment), the problem in #2619, and extra compatibility issues between client-nuxt and the @pinia/colada plugin (#2595)

Besides fixing all of the above, client-ofetch also grows the Hey API built-in toolbox with another popular HTTP client ofetch.

Features

  • client-ofetch is a universal (runtime-agnostic) ofetch‑based client
  • client-ofetch supports native ofetch hooks, retry / timeout / dispatcher / agent, SSE, responseStyle / throwOnError, parseAs / responseType
  • native hey api integration

Problem details

Right now, client-nuxt is tailored for Nuxt own composables (useAsyncData / useFetch / etc). At the same time, @pinia/colada is a more advanced way to work with the apps infra layer in vue.js projects.

The tight coupling of client-nuxt to Nuxt itself (imports from nuxt/app / vue) makes it a bad fit for Nitro server routes / SSR and for universal libraries like @pinia/colada.

Also, trying to stretch client-nuxt to be "universal" leads to higher coupling and hacks in codegen (branching on isNuxtClient in @pinia/colada and in the SDK). This bloats types and makes the codebase harder to maintain.

In conclusion, it would be nice to have a standalone ofetch, without any ties to Nuxt.

Migration plan

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Sep 14, 2025

🦋 Changeset detected

Latest commit: 0e4a063

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 14, 2025

@brolnickij is attempting to deploy a commit to the Hey API Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

codecov bot commented Sep 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.26%. Comparing base (b59afd5) to head (0e4a063).
⚠️ Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2642      +/-   ##
==========================================
+ Coverage   24.36%   25.26%   +0.89%     
==========================================
  Files         378      385       +7     
  Lines       36466    37085     +619     
  Branches     1640     1781     +141     
==========================================
+ Hits         8885     9369     +484     
- Misses      27568    27703     +135     
  Partials       13       13              
Flag Coverage Δ
unittests 25.26% <ø> (+0.89%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

pkg-pr-new bot commented Sep 14, 2025

Open in StackBlitz

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/codegen-core@2642
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@2642
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@2642
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@2642

commit: 0e4a063

@brolnickij brolnickij marked this pull request as ready for review September 15, 2025 11:41
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. client Client package related feature 🚀 New feature or request labels Sep 15, 2025
@mrlubos
Copy link
Member

mrlubos commented Sep 22, 2025

I plan to get to this later today

Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really well done! Thank you!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 22, 2025
@mrlubos mrlubos merged commit efd4e88 into hey-api:main Sep 22, 2025
15 of 16 checks passed
@hey-api hey-api bot mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client package related feature 🚀 New feature or request lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants